package com.qst.rongxiaoserver.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qst.rongxiaoserver.mapper.ReserveMapper;
import com.qst.rongxiaoserver.model.ReserveModel;
import com.qst.rongxiaoserver.model.dto.ReserveDto;
import com.qst.rongxiaoserver.service.IReserveService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

@Service
public class ReserveServiceImpl extends ServiceImpl<ReserveMapper, ReserveModel> implements IReserveService  {

    @Override
    public Boolean addReserve(ReserveDto reserveDto) {
        ReserveModel reserve = new ReserveModel();
        BeanUtils.copyProperties(reserveDto,reserve);
        return save(reserve);

    }
    @Override
    public ReserveModel getReserveByUserId(Integer rid) {
          return this.getById(rid);
    }
}

